package com.chen.bpsptsystem.utils;

import com.google.common.base.Splitter;

import java.util.List;
import java.util.stream.Collectors;

public class StringUtil {

    //1,2,3
    public static List <Integer> splitToListInt(String str) {
        List <String> stringList = Splitter.on( "," ).trimResults().omitEmptyStrings().splitToList( str );
        return stringList.stream().map( strItem -> Integer.parseInt( strItem ) ).collect( Collectors.toList() );
    }


    public static List <String> splitToListString(String str) {
        List <String> stringList = Splitter.on( "," ).trimResults().omitEmptyStrings().splitToList( str );
        return stringList.stream().map( strItem -> strItem ).collect( Collectors.toList() );
    }
}
